package com.docker.sys.area;

import com.docker.core.constant.APPIDConstant;
import com.docker.core.mvc.APPID;
import com.docker.core.mvc.Remark;
import com.docker.core.mvc.controller.BaseAPIController;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Okv;
import com.jfinal.kit.StrKit;

/**
 * @Author ldl
 * @Create 2020/10/30 030 20:03
 */
@Remark("系统区域管理")
@APPID(APPIDConstant.dum_web)
public class AreaController extends BaseAPIController {

    @Inject
    private AreaService areaService;

    /**
     * @Param: []
     * @Author: ldl
     * @Create: 2020/10/30 030 20:18
     */
    @Remark("下拉列表")
    public void look() {
        Okv cond = Okv.create();
        if (StrKit.isBlank(getPara("area_pcode"))) {
            cond.set("a.area_pcode = ", "100000");
        } else {
            cond.set("a.area_pcode = ", getPara("area_pcode"));
        }
        renderAPISuccess(areaService.look(Okv.by("cond", cond)));
    }

}
